<div class="form-row col-12">
    <div class="form-group col-sm-6 col-md-1">
        <label for="id_limit" class="col-form-label">표시개수</label>
        <select name="limit" class="form-control" id="id_limit">
            <option value="" selected="">---------</option>
            <option value="5" {% if request.GET.limit == '5' %}selected{% endif %}>5 개</option>
            <option value="10" {% if request.GET.limit == '10' %}selected{% endif %}>10 개</option>
            <option value="15" {% if request.GET.limit == '15' %}selected{% endif %}>15 개</option>
            <option value="20" {% if request.GET.limit == '20' %}selected{% endif %}>20 개</option>
            <option value="25" {% if request.GET.limit == '25' %}selected{% endif %}>25 개</option>
            <option value="30" {% if request.GET.limit == '30' %}selected{% endif %}>30 개</option>
        </select>
    </div>
    <div class="form-group col-md-1">
        <label for="id_group" class="col-form-label">차수</label>
        <select name="group" class="form-control" id="id_group">
            <option value="">---------</option>
            {% for group in groups %}
                <option value="{{ group.id }}" {% if request.GET.group == group.id|stringformat:"s" %}selected{% endif %}>{{ group }}</option>
            {% endfor %}
        </select>
    </div>
    <div class="form-group col-md-1">
        <label for="id_type" class="col-form-label">타입</label>
        <select name="type" class="form-control" id="id_type">
            <option value="">---------</option>
            {% for type in types %}
                <option value="{{ type.id }}" {% if request.GET.type == type.id|stringformat:"s" %}selected{% endif %}>{{ type }}</option>
            {% endfor %}
        </select>
    </div>
    {% if this_project.is_unit_set %}
        <div class="form-group col-sm-6 col-md-1">
            <label for="id_dong" class="col-form-label">동별</label>
            <select name="dong" class="form-control" id="id_dong">
                <option value="" selected="">---------</option>
                {% for dong in dongs %}
                    <option value="{{ dong.bldg_no }}"
                            {% if request.GET.dong == dong.bldg_no %}selected{% endif %}>
                        {{ dong.bldg_no }} 동
                    </option>
                {% endfor %}
            </select>
        </div>
    {% endif %}
    <div class="form-group col-md-1">
        <label for="id_status" class="col-form-label">상태</label>
        <select name="status" class="form-control" id="id_status">
            <option value="">---------</option>
            <option value="2" {% if request.GET.status == '2' %}selected{% endif %}>정상계약</option>
            <option value="3" {% if request.GET.status == '3' %}selected{% endif %}>해지신청</option>
        </select>
    </div>
    <div class="form-group col-md-1">
        <label for="id_register" class="col-form-label">인가구분</label>
        <select name="register" class="form-control" id="id_register">
            <option value="">---------</option>
            <option value="1" {% if request.GET.register == '1' %}selected{% endif %}>인가</option>
            <option value="2" {% if request.GET.register == '2' %}selected{% endif %}>미인가</option>
        </select>
    </div>
    <div class="form-group col-sm-6 col-md-2">
        <label for="id_order" class="col-form-label">정렬순서</label>
        <select name="order" class="form-control" id="id_order">
            <option value="0" {% if request.GET.order == '0' %}selected{% endif %}>등록일시 내림차순</option>
            <option value="1" {% if request.GET.order == '1' %}selected{% endif %}>등록일시 올림차순</option>
            <option value="2" {% if request.GET.order == '2' %}selected{% endif %}>계약일자 내림차순</option>
            <option value="3" {% if request.GET.order == '3' %}selected{% endif %}>계약일자 올림차순</option>
            <option value="4" {% if request.GET.order == '4' %}selected{% endif %}>일련번호 내림차순</option>
            <option value="5" {% if request.GET.order == '5' %}selected{% endif %}>일련번호 올림차순</option>
            <option value="6" {% if request.GET.order == '6' %}selected{% endif %}>계약자명 내림차순</option>
            <option value="7" {% if request.GET.order == '7' %}selected{% endif %}>계약자명 올림차순</option>
        </select>
    </div>
    <div class="form-group col-md-1">
        <label for="id_sdate" class="col-form-label">계약 기간</label>
        <input type="text" name="sdate" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-toggle="input-mask" data-mask-format="0000-00-00" placeholder="시작일" class="form-control" id="id_sdate" maxlength="10">
    </div>
    <div class="form-group col-md-1">
        <label for="id_edate" class="d-none d-md-block col-form-label">&nbsp;</label>
        <input type="text" name="edate" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-toggle="input-mask" data-mask-format="0000-00-00" placeholder="종료일" class="form-control" id="id_edate" maxlength="10">
    </div>
    <div class="form-group col-md-{% if this_project.is_unit_set %}2{% else %}3{% endif %}">
        <label for="{{ form.q.id_for_label }}"
               class="d-none d-md-block col-form-label">&nbsp;</label>
        <div class="input-group">
            <input name="q" id="id_q" type="text" class="form-control"
                   placeholder="검색어 - 계약자명, 비고" aria-label="검색어 - 일련번호, 계약자명, 비고"
                   value="{{ request.GET.q }}"
                   onclick="this.value=''">
            <div class="input-group-append">
                <input type="submit" class="btn btn-info btn-sm btn-block" value="검색">
            </div>
        </div>
    </div>
</div>
